package com.cdc.http.http2;

/**
 * Created by admin on 2018/3/24.
 */

public class Message implements Runnable{
    private Response response;
    private HttpListener httpListener;

    public Message(Response response,HttpListener httpListener) {
        this.response = response;
        this.httpListener=httpListener;
    }

    @Override
    public void run() {
        //这里被会掉到主线程
        Exception exception=response.getException();
        if(exception!=null){
            httpListener.onFail(exception);
        }else{
            httpListener.onSuccesed(response);
        }

    }
}
